
$(function () {
    initializeJob();
});

function deleteJob() {

}

function createJob() {
    var url="/cykmr/job/createJob";
    $.ajax({
        type:"post",
        dataType:"json",
        url:url,
        data:{
            jobName:$("#job-name").val(),
            jobType:$("#job-type").val(),
            jarPath:$("#jar-path").val(),
            jobInput:$("#job-input").val(),
            jobOutput:$("#job-output").val()
        },
        success:function (data) {
        console.log("success！");
        }

    })
}

function startJob() {
    var jobId=$("#job-id").val();
    var url="/cykmr/manage/startJob";
    $.ajax({
        type:"post",
        dataType:"json",
        url:url,
        data:{
            jobId:jobId
        },
        success:function (data) {
            console.log("running....");
        }

    })
}

function initializeJob() {
       deleteJob();
   $("#create-job").click(function () {
       createJob();
   });
   $("#job-start").click(function () {
       startJob();
   });

}
